home *** CD-ROM | disk | FTP | other *** search
/ Atari Forever 4 / Atari Forever 4.zip / Atari Forever 4.iso / SERIE_S / S_913 / STIKCOVL / MODULE.H < prev    next >
C/C++ Source or Header  |  1998-03-14  |  4KB  |  137 lines

  1. /* 
  2. ** module.h for Inet-Module
  3. ** API header for HTML.APP browser inet-module
  4. ** 
  5. ** Copyright (C) 1995, Stephane Boisson. All Rights reserved.
  6. ** Login <boisson@worldnet.net>
  7. ** 
  8. ** Started on  Sun Aug 27 22:21:42 1995 Stephane Boisson
  9. ** Last update Mon Aug 28 00:45:32 1995 Stephane Boisson
  10. ** 
  11. ** This file can be redistributed under the terms of the GNU General
  12. ** Public Licence.
  13. */
  14.  
  15. #ifndef __BROWSER_INET_API__H__
  16. #define __BROWSER_INET_API__H__
  17.  
  18. /*--- Macro for prototyping ---*/
  19. #ifdef __PUREC__
  20. #  define ___CDECL cdecl
  21. #else
  22. #  define ___CDECL
  23. #endif
  24.  
  25.  
  26. /*--- Magic values ---*/
  27. #define BROWSER_MAGIC1 0x48744d6cL
  28. #define BROWSER_MAGIC2 0x2f577757L
  29. #define BROWSER_MAGIC3 0x2d42724fL
  30. #define BROWSER_MAGIC4 0x77536552L
  31.  
  32. /*--- Init codes ---*/
  33. #define SUPPORT_PEXEC 1    /* module uses pexec() to call another prog */
  34. #define SUPPORT_HTTP 2
  35. #define SUPPORT_FTP 4
  36. #define SUPPORT_GOPHER 8
  37. #define SUPPORT_WAIS 16
  38. #define SUPPORT_MAILTO 32
  39. #define SUPPORT_NNTP 64
  40. #define SUPPORT_TELNET 128
  41.  
  42. /*--- Messages types for `msg_status' ---*/
  43. #define STATUS_CONNECTING_HOST 1
  44. #define STATUS_RECEIVING_DATA 2     /* val = bytes received */
  45. #define STATUS_WAITING_RESPONSE 3 
  46. #define STATUS_RESOLVING_HOST 4
  47. #define STATUS_SENDING_REQUEST 5
  48. #define STATUS_FORMATTING_TEXT 6
  49. #define STATUS_LOADING_IMAGE 7
  50.  
  51. /*--- Alert boxes for `alert_box' ---*/
  52. #define ALERT_ABORT 0      /* [2][Abort?][Yes|No] */
  53.  
  54. /*--- Request types for `ask_user' ---*/
  55. #define REQUEST_NAME 0     /* Document protected, enter name (account) */
  56. #define REQUEST_PASSWORD 1 /* Document protected, enter password       */
  57.  
  58. /*--- Internal images bullets ---*/
  59. #define BULLET_FOLDER "<img src=\"internal-gopher-menu\">"
  60. #define BULLET_TEXT "<img src=\"internal-gopher-text\">"
  61. #define BULLET_IMAGE "<img src=\"internal-gopher-image\">"
  62. #define BULLET_MOVIE "<img src=\"internal-gopher-movie\">"
  63. #define BULLET_SOUND "<img src=\"internal-gopher-sound\">"
  64. #define BULLET_INDEX "<img src=\"internal-gopher-index\">"
  65. #define BULLET_BINARY "<img src=\"internal-gopher-binary\">"
  66. #define BULLET_UNKNOW "<img src=\"internal-gopher-unknown\">"
  67.  
  68.  
  69. /*--- Module functions used by the browser ---*/
  70. typedef struct
  71. {
  72.   void ___CDECL (*restore)(void);
  73.   long ___CDECL (*get_url)(char *url, char *filename);
  74.   long ___CDECL (*get_url_info)(char *url, long *time, long *size, char *mime);
  75.   void ___CDECL (*get_version)(char **author, long *version, long *date);
  76.   long ___CDECL (*post)(char *url, char *content, char *enctype, char *filename);
  77.  
  78.   long reserved[5];
  79. } url_methods_t;
  80.  
  81.  
  82. /*--- Browser functions intended to be used by module ---*/
  83. typedef struct
  84. {
  85.   /*___AES arrays in case of GEM use___*/
  86.   int *aes_control;
  87.   int *aes_global;
  88.   int *aes_intin;
  89.   int *aes_intout;
  90.   long   *aes_addrin;
  91.   long   *aes_addrout;
  92.  
  93.   /*___Init AES in case of GEM use___*/
  94.   void   ___CDECL (*aes_crystal)(void);
  95.  
  96.   /*___Send AES messages to browser___*/
  97.   void   ___CDECL (*aes_messages)(int *msg);
  98.  
  99.   /*___Display error message (see errno.h)___*/
  100.   void   ___CDECL (*msg_error)(long errno);
  101.  
  102.   /*___Display status message___*/
  103.   void   ___CDECL (*msg_status)(long no, long val);
  104.  
  105.   /*___Sleeps for `time' msec, returns pointer to AES msg___*/
  106.   /* 0L -> no message, go on / -1L -> no messages abort */
  107.   long   ___CDECL (*aes_events)(long msec);
  108.  
  109.   /*___Alert box___*/
  110.   long   ___CDECL (*alert_box)(long button, long msg);
  111.  
  112.   /*___Use in case of pexec(0, ...)___*/
  113.   void   ___CDECL (*begin_pexec)();
  114.   void   ___CDECL (*end_pexec)();
  115.   
  116.   /*___Clear cache to get at least `size' bytes free___*/
  117.   /* -1 -> failure / 0 -> OK */
  118.   int ___CDECL (*clear_cache)(long size);
  119.  
  120.   /*___Get a new filename for specific URL___*/
  121.   /* -1 -> already cached / 0 -> OK */
  122.   int ___CDECL (*new_url)(char *url, char **file);
  123.   
  124.   /*___Ask user for a text entry ___*/
  125.   /* 1 -> OK button / 0 -> CANCEL button / -1 -> error*/ 
  126.   int ___CDECL (*ask_user)(long msg, char **answer);
  127.   
  128.   /*___Address of the basepage of the module__*/
  129.   long basepage;
  130.  
  131.   /*___Reserved for future uses___*/
  132.   long   reserved[5];
  133. } browser_info_t;
  134.  
  135.  
  136. #endif /* !__BROWSER_INET_API__H__ */
  137.